package main
// ModeFragment 模式片段指标输出
type ModeFragment struct {
	DevId        string  `json:"dev_id" gorm:"type:varchar(50);not null;index:dev_id_idx"`
	StartTime    string  `json:"start_time" gorm:"type:varchar(20);not null;index:start_time_idx"`
	EndTime      string  `json:"end_time" gorm:"type:varchar(20);not null"`
	DurationTime string  `json:"duration_time" gorm:"type:varchar(20);not null"`
	WaterPattern int     `json:"water_pattern" gorm:"type:int;not null"`
	FlowAvg      float64 `json:"flow_avg" gorm:"type:float;not null"`
	SmallWater   float64 `json:"small_water" gorm:"type:float;not null"`
	//Extreme              int     `json:"extreme" gorm:"type:int;not null"`
	//MaxChange            float64 `json:"max_change" gorm:"type:float;not null"`
	//Average              float64 `json:"average" gorm:"type:float;not null"`
	Deviation            float64 `json:"deviation" gorm:"type:float;not null"`
	UpNumber             int     `json:"up_number" gorm:"type:int;not null"`
	DownNumber           int     `json:"down_number" gorm:"type:int;not null"`
	WaterScore           int     `json:"water_score" gorm:"int;not null"`
	HeatDuration         string  `json:"heat-duration" gorm:"type:varchar(20);not null"`
	UnStableTempDuration string  `json:"un_stable_temp_duration" gorm:"type:varchar(20);not null"`
	UnStableTempPercent  float64 `json:"un_stable_temp_percent" gorm:"type:float;not null"`
	UnHeatDev            float64 `json:"un_heat_dev" gorm:"type:float;not null"`
	TempPattern          int     `json:"temp_pattern" gorm:"type:int;not null"`
	OvershootValue       int     `json:"overshoot_value" gorm:"type:int;"`
	StateAccuracy        int     `json:"state_accuracy" gorm:"type:int;"`
	TempScore            int     `json:"temp_score" gorm:"type:int;not null"`
	NewTempScore         int     `json:"new_temp_score" gorm:"type:int;not null"`
	HeatTempScore        int     `json:"heat_temp_score" gorm:"type:int;not null"`
	StableTempScore      int     `json:"stable_temp_score" gorm:"type:int;not null"`
	TempScoreJudgeFlag   bool    `json:"temp_judge_flag" gorm:"type:bool;not null"`
	WaterFlag            int     `json:"water_flag" gorm:"type:int;not null"`
	TempFlag             int     `json:"temp_flag" gorm:"type:int;not null"`
	AbnormalState        int     `json:"abnormal_state" gorm:"type:int;not null"`
	TabName              string  `gorm:"-"`
}

//原始城市数据
type Original struct {
	CityCode     string `json:"city_code" gorm:"type:varchar(255);not null"`
	DataTime     string `json:"data_time" gorm:"type:varchar(255);not null"`
	Applianceid  string `json:"applianceid" gorm:"type:varchar(50);not null;index:applianceid_idx"`
	Flame        int    `json:"flame" gorm:"type:int;not null"`
	Flow         int    `json:"flow" gorm:"type:int;not null"`
	Outtemp      int    `json:"out_temp" gorm:"type:int;not null"`
	Settemp      int    `json:"set_temp" gorm:"type:int;not null"`
}
type Original1 struct {
	CityCode     string `json:"city_code" gorm:"type:varchar(255);not null"`
	DataTime     string `json:"data_time" gorm:"type:varchar(255);not null"`
	Applianceid  string `json:"applianceid" gorm:"type:varchar(50);not null;index:applianceid_idx"`
	Flame        int    `json:"flame" gorm:"type:int;not null"`
	Flow         int    `json:"flow" gorm:"type:int;not null"`
	Outtemp      int    `json:"out_temp" gorm:"type:int;not null"`
	Settemp      int    `json:"set_temp" gorm:"type:int;not null"`
	NewTempScore         int     `json:"new_temp_score" gorm:"type:int;not null"`
	TempScore            int     `json:"temp_score" gorm:"type:int;not null"`
}